package com.auth.manage.user.domain.entity;

import com.auth.manage.datasource.domain.entity.BaseEntity;
import com.auth.manage.user.constant.UserOperateTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserOperateStream extends BaseEntity {

    /**
     * 用户ID
     */
    private Long userId;

    // todo 用枚举好还是直接用String好
    /**
     * 操作类型
     */
    private UserOperateTypeEnum type;

    /**
     * 操作时间
     */
    private Date operateTime;

    public void record(Long userId, UserOperateTypeEnum userOperateTypeEnum) {
        this.operateTime = new Date();
        this.type = userOperateTypeEnum;
        this.userId = userId;
    }

    // todo 下面两个是Hollis定义的
//    /**
//     * 操作参数
//     */
//    private String param;

//    /**
//     * 扩展字段
//     */
//    private String extendInfo;

}
